void main(List<String> args) {
  // 准备购物车数据
  List carts = [
    {"count": 2, "price": 10.0, "selected": true},
    {"count": 1, "price": 30.0, "selected": true},
    {"count": 5, "price": 20.0, "selected": true}
  ];
  //方法1：
  bool res = getSelectedStatus(carts);
  print(res ? '全部选中' : '未全选');
  //方法2：
  print(carts.every((item) => item["selected"]) ? '全部选中' : '未全选');
}

bool getSelectedStatus(List list) {
  bool isSelected = true;
  for (var item in list) {
    if (item["selected"] == false) {
      isSelected = false;
      break;
    }
  }
  return isSelected;
}
